<?php
	include "../ini.php";
	include "../../libraries/xl_loai_san_pham.php";
	include "../../libraries/pager.php";
	$dt_pager= new pager;
	$dt_loai_san_pham = new xl_loai_san_pham;
	
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php include"../includes/js_css.php"?>
</head>
<body>
<div id="body-wrapper"> <!-- Wrapper for the radial gradient background -->
  
  <?php include"../widgets/sidebar.php"?>
  <!-- End #sidebar -->
  
  <div id="main-content"> <!-- Main Content Section with everything -->
    
    <?php include"../widgets/noscript.php"?>
    <div class="clear"></div>
    <!-- End .clear -->
    
    <div class="content-box"><!-- Start Content Box -->
      
      <div class="content-box-header">
        <h3>Danh sách loại sản phẩm</h3>
        <div class="clear"></div>
      </div>
      <!-- End .content-box-header -->
      
      <div class="content-box-content">
        <div class="tab-content default-tab" id="tab1"> <!-- This is the target div. id must match the href of this div's tab -->      
          <div><?php message();?></div>
          <form action="deletes.php" method="post" name="f2">
          <table>
            <thead>
              <tr>
                <th>Mã</th>
                <th>Tên Loại sản phẩm</th>
                <th style="text-align: center !important;">Thứ Tự Hiển Thị</th>
                <th style="text-align: center !important;">Thuộc Về</th>
                <th style="text-align: center !important;"> <input class="check-all" type="checkbox" id="check_all" onclick="chon()">
                </th>
              </tr>
            </thead>
            <tfoot>
              <tr>
                <td colspan="6"><div class="bulk-actions align-left">
                    <input class="button" type="submit" value="Xóa">
                    <input class="button" type="button" value="Thêm" onclick="window.location.href='them.php'">
                  </div>
                  <div class="pagination"> 
                  <?php //phan trang
					  $tong_so_dong = $dt_loai_san_pham->so_luong();
					  $tong_so_trang = $dt_pager->findPages($tong_so_dong,ADMIN_LIMIT);
					  echo $dt_pager->pageList($_GET['page'],$tong_so_trang);			  
				  ?>
                   </div></td>
              </tr>
            </tfoot>
            <tbody>
            <?php 
				$vitri = $dt_pager->findStart(ADMIN_LIMIT);
				$ds_loai_san_pham = $dt_loai_san_pham->danh_sach($vitri,ADMIN_LIMIT);
				foreach($ds_loai_san_pham as $loai_san_pham){
			?>
              <tr>
                <td><?php echo $loai_san_pham["ma"];?></td>
                <td ><a href="#"><?php echo $loai_san_pham["ten"];?></a></td>
                <td  style="text-align: center !important;"><?php echo $loai_san_pham["thu_tu_hien_thi"];?></td>
                <td style="text-align: center !important;"><?php echo $loai_san_pham["ten_loai_cha"];?></td>
                <td style="text-align: center !important;"><a title="Edit" href="edit.php?id=<?php echo $loai_san_pham['ma']?>">
                 <img alt="Edit" src="../skins/sa/resources/images/icons/pencil.png">
                 </a> <a title="Delete" href="delete.php?id=<?php echo $loai_san_pham['ma']?>"> <img alt="Delete" src="../skins/sa/resources/images/icons/cross.png"> </a>
                  <input type="checkbox" value="239" name="item[]"></td>	
              </tr>
              <?php 
				}
			  ?>
            </tbody>
          </table>
          </form>
        </div>
        <!-- End #tab1 --> 
        
      </div>
      <!-- End .content-box-content --> 
      
    </div>
    <!-- End .content-box -->
    
    <div class="clear"></div>
    <?php include"../widgets/footer.php"?>
  </div>
  <!-- End #main-content --> 
  
</div>
</body>
</html>
